package reflect;

import reflect.annotations.AutoRunClass;
import reflect.annotations.AutoRunMethod;

@AutoRunClass
public class Teacher {
    public String name = "小明";
    private int age = 40;
    public Teacher(){}
    public Teacher(String name, int age) {
        this.name = name;
        this.age = age;
    }
    @AutoRunMethod
    public void teach(){
        System.out.println(name + "在教书");
    }
    @AutoRunMethod
    public void sing(){
        System.out.println(name + "在唱歌");
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
